package com.ysd.ziyuanshiyongtongji.dao;

import java.util.List;

import com.ysd.ziyuanshiyongtongji.model.Member;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

/**
 * IMemberDao
 */
public interface IMemberDao extends JpaRepository<Member,Integer>,JpaSpecificationExecutor<Member>{
 @Query("select m from Member m where m.cardNo =:cardNo")
	Member getCardStatus(String cardNo);
 @Transactional
 @Modifying
 @Query(value = "delete from member where id in (:ids)",nativeQuery = true)
   public int deletebatch(@Param("ids") List<Integer> ids); 
 
   @Transactional
   @Modifying
   @Query(value = "update member set status=?1 where id=?2",nativeQuery = true)
    int editTable(String status,Integer id);
  }